using System;
using System.Diagnostics.CodeAnalysis;
using System.Web.Security;

namespace iPhOwa.Web
{
	/// <summary>
	/// Logs user out and expires cookies.
	/// </summary>
	[SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Logout")]
	public partial class Logout : iPhOwaPage
	{
		/// <summary>
		/// Determines if we need to auth for this page.
		/// </summary>
		protected override bool IsSecurePage
		{
			get { return false; }
		}

		/// <summary>
		/// Page_Load Event
		/// </summary>
		protected void Page_Load(object sender, EventArgs e)
		{
			ExpireCookie(UserNameCookie);
			ExpireCookie(PasswordCookie);
			Session.Abandon();
			FormsAuthentication.SignOut();
			Response.Redirect(FormsAuthentication.DefaultUrl);
		}
	}
}